package com.ruoyi.qsng.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.uuid.SnowFlakeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.qsng.mapper.KCourseRefundMapper;
import com.ruoyi.qsng.domain.KCourseRefund;
import com.ruoyi.qsng.service.IKCourseRefundService;

/**
 * 课程退费Service业务层处理
 * 
 * @author kanglou
 * @date 2023-06-07
 */
@Service
public class KCourseRefundServiceImpl implements IKCourseRefundService 
{
    @Autowired
    private KCourseRefundMapper kCourseRefundMapper;

    /**
     * 查询课程退费
     * 
     * @param id 课程退费主键
     * @return 课程退费
     */
    @Override
    public KCourseRefund selectKCourseRefundById(String id)
    {
        return kCourseRefundMapper.selectKCourseRefundById(id);
    }

    /**
     * 查询课程退费列表
     * 
     * @param kCourseRefund 课程退费
     * @return 课程退费
     */
    @Override
    public List<KCourseRefund> selectKCourseRefundList(KCourseRefund kCourseRefund)
    {
        return kCourseRefundMapper.selectKCourseRefundList(kCourseRefund);
    }

    /**
     * 新增课程退费
     * 
     * @param kCourseRefund 课程退费
     * @return 结果
     */
    @Override
    public int insertKCourseRefund(KCourseRefund kCourseRefund)
    {
        kCourseRefund.setId(SnowFlakeUtil.getNextId());
        kCourseRefund.setCreateTime(DateUtils.getNowDate());
        return kCourseRefundMapper.insertKCourseRefund(kCourseRefund);
    }

    /**
     * 修改课程退费
     * 
     * @param kCourseRefund 课程退费
     * @return 结果
     */
    @Override
    public int updateKCourseRefund(KCourseRefund kCourseRefund)
    {
        kCourseRefund.setUpdateTime(DateUtils.getNowDate());
        return kCourseRefundMapper.updateKCourseRefund(kCourseRefund);
    }

    /**
     * 批量删除课程退费
     * 
     * @param ids 需要删除的课程退费主键
     * @return 结果
     */
    @Override
    public int deleteKCourseRefundByIds(String[] ids)
    {
        return kCourseRefundMapper.deleteKCourseRefundByIds(ids);
    }

    /**
     * 删除课程退费信息
     * 
     * @param id 课程退费主键
     * @return 结果
     */
    @Override
    public int deleteKCourseRefundById(String id)
    {
        return kCourseRefundMapper.deleteKCourseRefundById(id);
    }
}
